$(function(){
	var urlApi="https://jindi163.com:8443/JDLot/admin/send/integral";
	var phono=$("#phone_numb").val();
	var integral=$("#jifen_num").val();
	$("#xubmit").click(function(){
		if ($("#phone_numb").val()=="" || $("#jifen_num").val()=="") {
		 alert("手机号和积分不能为空！")
	} else{
		 
		 phono=$("#phone_numb").val();
		 integral=$("#jifen_num").val();
//		console.log(phono+"----"+integral+"----"+phone)
		$.ajax({
		    url:urlApi,  
		    type:'post',
		    async:true,
			dataType:'json', 
            contentType:"application/json",
		    data: {
			"phono":phono,
			"integral":integral,
		},//参数配置：
		xhrFields: {
   						 withCredentials: true
						},
					crossDomain: true,
		success:function(res){
			console.log(res)
			if(res.msgContext=="success"){
				alert("充值成功！")
			}else{
				alert("充值失败")
			}
//			
		},
		error:function(err){
			alert("手机号码输入有误");
			}
	})
		$("#phone_numb").empty();
		$("#jifen_num").empty();
	}
		
	})
})
